import React from 'react'
import { getMenuSub } from 'services/utils'
import { Icon } from 'antd'
import BaseInfo from './baseinfo'
import Secure from './secure'
import Flag from 'config/flag'

const routes = {
  path: '/account',
  name: '个人中心',
  childRoutes: [
    //{ path: 'default', name: 'Home', component: Screen, isIndex: true },
    { 
      path: 'baseinfo', 
      name: '基本资料', 
      component: BaseInfo, 
      flags: Flag['/account/baseinfo'],
      description: '修改当前用户的基础资料'
    },
    {
      path: 'secure',
      name: '安全设置',
      component: Secure,
      flags: Flag['/account/secure'],
      description: '修改当前用户的头像、密码、电子邮箱等重要数据'
    }
  ]
}

export default routes

export const menuSub = getMenuSub(routes, {
    key:   `account`, 
    //name:  `帐号管理`, 
    icon:  <Icon type="user" />
  })